const fs = require('fs')
const readStream = fs.createReadStream('test.txt')

readStream.on('data', (chunk) => {
  console.log(`Received ${chunk.length} bytes of data.`)
  readStream.pause()
  console.log('There will be no additional data for 1 second.')
  setTimeout(() => {
    console.log('Now data will start flowing again.')
    readStream.resume()
  }, 1000)
})
